/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package clsLib;

import java.util.ArrayList;

/**
 *
 * @author j1aha1ta
 */
public  class AccountUnit {
    
       //未使用商品、账户列表实现方式接口，直接选取构建动态数组方式
        public static ArrayList<User> userList = new ArrayList();
      
        public static void add(User user){
		userList.add(user);
	}
        
        public static void setDefaultUser(){
            User user =new User();
            userList.add(user);
        }
        
        public static boolean isHas(String account){
             for (User user:userList) {
		if (user.getAccount().equals(account)) 
                    return true;       
                }
             return false;
         }
        
        public static User getUser(String account){
            
            for (User user:userList) 
                if (user.getAccount().equals(account))                   
                    return user;
            
            return null;
        }
        
        
}
